const express =require('express')
const router=express.Router()

//挂载路由

//导入路由处理函数模块
const userinfo_handler=require('../root_handler/userinfo')

const expressJoi=require('@escook/express-joi')
//导入需要的验证对象
const {update_userinfo_schema,update_avatar_schema}=require('../schema/user')

//获取用户基本信息的路由
router.get('/userinfo',userinfo_handler.getUserInfo)

//更新用户信息的路由
router.post('/userinfo',expressJoi(update_userinfo_schema),userinfo_handler.updateuserInfo)

//更换头像的路由
router.post('/update/avatar',expressJoi(update_avatar_schema),userinfo_handler.updateAvatar)

module.exports=router